<?php

class menumaker
{
	private $menuheader;
	private $divmenuopen;
	private $divclose;
	private $divcontentopen;
	private $menuitemopen;
	private $menusubitem;
	private $menuitemclose;
	private $menuitemtag;
	
	function __construct()
	{
		$this->menuheader='<div id="Menu_header">
              <div class="menu_header_left"> <span class="menu_text">MENU</span> </div>
              <div class="menu_header_right"> </div>
            </div>';
		$this->divcontentopen='<div id="Menu_content">';
		$this->menuitemopen='<a class="menu_item" href="';
		$this->menuitemtag='"><span>';
		$this->menuitemclose='</span></a><br />';
		$this->menusubitem='<a class="menu_item2" href="';
		$this->divclose='</div>';
		$this->divmenuopen='<div id="Menu">';
	}
	
	
	function get_menu()
	{
		$menu= $this->divmenuopen.$this->menuheader.$this->divcontentopen;
		$menu.=$this->menulist();
		$menu.= $this->divclose;
		$menu.= $this->divclose;
		return $menu;
	}
	
	private function menulist() //simulazione ... i dati verranno presi dal database.
	{
		$menucontent='';
		for($i=0;$i<5;$i++)
		{
			$item=$this->menuitemopen.'sazizza'.$this->menuitemtag.'categoria'.' '.$i.$this->menuitemclose;
			$menucontent.= $item;
			for ($j=0;$j<3;$j++)
			{
				$item=$this->menusubitem.'sazizza'.$this->menuitemtag.'sottocategoria'.' '.$i.$this->menuitemclose;
				$menucontent.= $item;
			}
			
		}
		return $menucontent;
	} 
}





?>